package com.beaven.imserver.net.service;

import com.beaven.imserver.net.bean.db.User;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.SecurityContext;

/**
 * author: Beaven
 * time: 2017/5/19 11:48
 */
public class BaseService {

  // 获取拦截器注册的SecurityContext
  @Context
  protected SecurityContext securityContext;

  // 从上下文获取 User
  User getSelf() {
    return (User) securityContext.getUserPrincipal();
  }
}
